package com.xy.learn.springlearn;

import com.xy.learn.springlearn.service.ElectricService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;

@EnableAspectJAutoProxy
@SpringBootApplication
@EnableWebMvc
public class SpringLearnApplication {

    public static void main(String[] args) throws InterruptedException {
        ConfigurableApplicationContext run = SpringApplication.run(SpringLearnApplication.class, args);
        ElectricService bean = run.getBean(ElectricService.class);
        bean.charge();
    }

}
